﻿package com.eitb.colecciones{
	
	public class Collections {
		public static function removeDuplicates(duplicates:Array):Array {
			var k:int = 0;
			var i:int = 0;
			
			duplicates.sort();
			
			for (i = 0; i < duplicates.length; i++) {
				if (i>0 && (duplicates[i] == duplicates[i-1])) {
					continue;
				}
				duplicates[k++]=duplicates[i];
			}

			return duplicates.slice(0,k);
		}
	}
}